class Contact < ActiveRecord::Base

	validates_presence_of :email
	validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
	
	has_and_belongs_to_many :contact_groups
	
	def to_s
		"#{name} &lt;#{email}&gt;"
	end
	
end
